package com.sx.micowell.module.learned

import android.view.View
import android.widget.ImageView
import com.bumptech.glide.Glide
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.miloyu.modelnet.response.LearnedCourseVO
import com.miloyu.modelnet.response.getUrl
import com.sx.micowell.R

/**
 * @Author: YY
 * @Time: 2021/8/13
 * @Describe TODO
 */
class LearnCourseListAdapter : BaseQuickAdapter<LearnedCourseVO, BaseViewHolder>(R.layout.item_collect_list) {

    override fun convert(holder: BaseViewHolder, item: LearnedCourseVO) {

        Glide.with(context).load(item.curriculumCover.getUrl())
            .into((holder.getView<View>(R.id.image_title) as ImageView))

        holder.setText(R.id.tv_title, item.curriculumTitle)
        holder.setText(R.id.tv_content, "${item.duration}分钟 · ${item.calorie}千卡 · ${item.basicConditions}" )

        holder.getView<View>(R.id.image_delete).visibility = View.GONE
    }
}